{	Problem: http://codeforces.ru/problemset/problem/98/A
	 Verdict: Accepted
}
uses
        SysUtils, Math;

const
        MAXN=6*6*6*6*6*6;

type
        state = array[1..6] of longint;

var
        i,ans:longint;
        s:string;
        st:array[0..10] of byte;
        b:array[0..MAXN] of boolean;
        bl:array[0..10] of boolean;
        a:state;

function convert(a,b,c,d,e,f:longint):state;
begin
result[1]:=a;
result[2]:=b;
result[3]:=c;
result[4]:=d;
result[5]:=e;
result[6]:=f;
end;

procedure res(a:state; f:boolean);

var
        h,i:longint;

begin
h:=0;
for i:=1 to 6 do
        h:=h*6+a[i]-1;
if b[h] then exit;
if f then inc(ans);
b[h]:=true;
res(convert(a[1],a[5],a[3],a[6],a[4],a[2]),false);
res(convert(a[5],a[2],a[6],a[4],a[3],a[1]),false);
end;

procedure go(x:longint);

var
        i:longint;
        
begin
if x>6 then begin
        res(A, true);
        exit;
end;
for i:=1 to 6 do 
        if not bl[i] then begin
                bl[i]:=true;
                a[x]:=st[i];
                go(x+1);
                bl[i]:=false;
        end;
end;
         
begin
fillchar(b,sizeof(b),0);
ans:=0;
readln(S);
for i:=1 to 6 do
        if s[i]='R' then st[i]:=1 else
        if s[i]='O' then st[i]:=2 else
        if s[i]='Y' then st[i]:=3 else
        if s[i]='G' then st[i]:=4 else
        if s[i]='B' then st[i]:=5 else
        if s[i]='V' then st[i]:=6 else assert(false);
go(1);
write(ans);
end.